import { ManyToMany,JoinTable,Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";
import { Base } from "libs/Entities/base.entity";
export enum UserRole {
    ADMIN = "admin",
    EDITOR = "editor",
    GHOST = "ghost"
}
@Entity()
export class User extends Base{
    @Column({
        type: 'varchar',
        unique: true,
        length: 50,
        comment: '用户名'
    })
    username: string;

    @Column({
        type: 'varchar',
        comment: '密码',
        select: false,
    })
    password: string;

    @Column({
        type: "enum",
        enum: UserRole,
        default: UserRole.ADMIN,
        comment: '角色'
    })
    role: string;

    @Column({
        nullable: true,
        length:30,
        comment: '邮箱'
    })
    email: string;

    @Column({
        type:"longtext",
        nullable: true,
        comment: '头像'
    })
    avatar: string;

    @Column({
        nullable: true,
        comment: '是否禁用',
        default:'0'
    }) 
    is_disable: string;
    
 

}
